import request from '@/utils/request'
const api_name = '/edu/service/course'
const api_teacher_name = '/edu/service/teacher'
export default {
  // 添加课程详细信息
  addCourseInfo(courseInfo) {
    return request({
      url: `${api_name}/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  // 查询所有讲师列表
  getListTeacher() {
    return request({
      url: `${api_teacher_name}/findAll`,
      method: 'get'
    })
  },
  // 根据id查询课程信息
  getCourseInfoById(courseId) {
    return request({
      url: `${api_name}/getCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  // 修改课程信息
  updateCourseInfo(courseInfo) {
    return request({
      url: `${api_name}/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  // 查询课程确认信息
  getPublishCourseInfo(courseId) {
    return request({
      url: `${api_name}/getPublishCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  //课程最终发布
  publishCourse(courseId) {
    return request({
      url: `${api_name}/publishCourse/${courseId}`,
      method: 'post'
    })
  },
  // 讲师列表 按条件查询
  getCourseListPage(current, limit, coureQueryVO) {
    return request({
      url: `${api_name}/pageCourseCondition/${current}/${limit}`,
      method: 'post',
      // data表示对象转换成json传递到接口里面
      data: coureQueryVO
    })
  },
   //根据courseId删除课程及课程以下内容
   deleteCourseById(courseId) {
    return request({
      url: `${api_name}/deleteCourse/${courseId}`,
      method: 'delete'
    })
  }
}
